package util;

import java.lang.reflect.Constructor;

public class MyReflectionUtil {
    public static <T> T getInstance(String className) {
        T dl;
        try {
            Class<?> downloaderClass = Class.forName(className);
            Constructor<?> declarConstructor = downloaderClass.getDeclaredConstructor();
            dl = (T) declarConstructor.newInstance();
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
        return dl;
    }

}
